<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<Animoso.Domain.Page>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AddContent
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>AddContent</h2>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Fields</legend>            
            <p>
                <label for="Title">Title:</label>
                <%= Html.TextBox("Title") %>
                <%= Html.ValidationMessage("Title", "*") %>
            </p>
            <p>
                <label for="Text">Text:</label><br />
                <%= Html.TextArea("Text","",14,60,
    new {
        id = "Text"
    })%>
                <%= Html.ValidationMessage("Text", "*") %>
            </p>
            <p>
                <input type="hidden" name="sectionId" value="<%=ViewData["sectionId"] %>" />
                <input type="submit" value="Create" class="wymupdate" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>
    <script type="text/javascript">

        jQuery(function() {

            jQuery('#Text').wymeditor({

                stylesheet: 'styles.css',

                //classes panel
                classesItems: [
        { 'name': 'date', 'title': 'PARA: Date', 'expr': 'p' },
        { 'name': 'hidden-note', 'title': 'PARA: Hidden note',
            'expr': 'p[@class!="important"]'
        },
        { 'name': 'important', 'title': 'PARA: Important',
            'expr': 'p[@class!="hidden-note"]'
        },
        { 'name': 'border', 'title': 'IMG: Border', 'expr': 'img' },
        { 'name': 'special', 'title': 'LIST: Special', 'expr': 'ul, ol' }
      ],

                //we customize the XHTML structure of WYMeditor by overwriting 
                //the value of boxHtml. In this example, "CONTAINERS" and 
                //"CLASSES" have been moved from "wym_area_right" to "wym_area_top":
                boxHtml: "<div class='wym_box'>"
              + "<div class='wym_area_top'>"
              + WYMeditor.TOOLS
              + WYMeditor.CONTAINERS
              + WYMeditor.CLASSES
              + "</div>"
              + "<div class='wym_area_left'></div>"
              + "<div class='wym_area_right'>"
              + "</div>"
              + "<div class='wym_area_main'>"
              + WYMeditor.HTML
              + WYMeditor.IFRAME
              + WYMeditor.STATUS
              + "</div>"
              + "<div class='wym_area_bottom'>"
              + "</div>"
              + "</div>",

                //postInit is a function called when WYMeditor instance is ready
                //wym is the WYMeditor instance
                postInit: function(wym) {

                    //we make all sections in area_top render as dropdown menus:
                    jQuery(wym._box)
                    //first we have to select them:
            .find(".wym_area_top .wym_section")
                    //then we remove the existing class which make some of them render as a panels:
            .removeClass("wym_panel")
                    //then we add the class which will make them render as a dropdown menu:
            .addClass("wym_dropdown")
                    //finally we add some css to make the dropdown menus look better:
            .css("width", "160px")
            .css("float", "left")
            .css("margin-right", "5px")
            .find("ul")
            .css("width", "140px");

                    //add a ">" character to the title of the new dropdown menus (visual cue)
                    jQuery(this._box).find(".wym_tools, .wym_classes ")
            .find(WYMeditor.H2)
            .append("<span>&nbsp;&gt;</span>");
                }
            });
        });

</script>

</asp:Content>

